#define _CRT_SECURE_NO_WARNINGS 1
#include <iostream>
using namespace std;
int GetMonthDay(int year, int month) {
    int arr[13] = { 0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
    if (month == 2 && ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0)) {
        return 29;
    }
    return arr[month];
}
class Date {
public:
    Date(int year, int month, int day)
        : _year(year)
        , _month(month)
        , _day(day) {

    }
    void operator++() {
        _day++;
        if (_day > GetMonthDay(_year, _month)) {
            _month++;
            _day = 1;
        }
        if (_month > 12) {
            _month = 1;
            _year++;
        }
    }
    bool operator>(const Date& d) {
        if (_year < d._year) {
            return false;
        }
        else if (_year == d._year) {
            if (_month < d._month) {
                return false;
            }
            else if (_month == d._month) {
                return _day > d._day;
            }
            else {
                return true;
            }
        }
        else {
            return true;
        }
    }
    Date& operator=(const Date& d) {
        _year = d._year;
        _month = d._month;
        _day = d._day;
        return *this;
    }
    bool operator==(Date& d)
    {
        return _year == d._year && _month == d._month && _day == d._day;
    }
    bool operator!=(Date& d)
    {
        return !(*this == d);
    }
private:
    int _year;
    int _month;
    int _day;
};
int main() {
    int a, b;
    while (cin >> a >> b) {
        int day1 = a % 100;
        int day2 = b % 100;
        int month1 = (a / 100) % 100;
        int month2 = (b / 100) % 100;
        int year1 = a / 10000;
        int year2 = b / 10000;
        int day = 0;
        Date A(year1, month1, day1);
        Date B(year2, month2, day2);
        Date max(A);
        Date min(B);
        if (B > A) {
            max = B;
            min = A;
        }
        int n = 1;
        while (min != max)
        {
            ++min;
            ++n;
        }
        cout << n << endl;
    }
}